]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-theme-node-drawing: Remove possible subtexturing
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 2 Feb 2012 11:53:47 +0000 (06:53 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 6 Feb 2012 13:01:33 +0000 (08:01 -0500)
Since our implementation of background-size is now CSS-compliant, we
do not need this subtexture hack that clips a "leak". The comment here
is also incorrect.

https://bugzilla.gnome.org/show_bug.cgi?id=633462

src/st/st-theme-node-drawing.c

index 08531c7e3084fe9859b6086f469ead23a1dc43f9..04a35478b5e2e3f33c062c2430688be2b6621b73 100644 (file)
@@ -1445,35 +1445,7 @@ st_theme_node_render_resources (StThemeNode   *node,
   background_image_shadow_spec = st_theme_node_get_background_image_shadow (node);
   if (background_image != NULL && !has_border && !has_border_radius)
     {
-      CoglHandle texture;
-
-      texture = st_texture_cache_load_file_to_cogl_texture (texture_cache, background_image);
-
-      /* If no background position is specified, then we will automatically scale
-       * the background to fit within the node allocation. But, if a background
-       * position is specified, we won't scale the background, and it could
-       * potentially leak out of bounds. To prevent that, we subtexture from the
-       * in bounds area when necessary.
-       */
-      if (node->background_position_set &&
-          (cogl_texture_get_width (texture) > width ||
-           cogl_texture_get_height (texture) > height))
-        {
-          CoglHandle subtexture;
-
-          subtexture = cogl_texture_new_from_sub_texture (texture,
-                                                          0, 0,
-                                                          width - node->background_position_x,
-                                                          height - node->background_position_y);
-          cogl_handle_unref (texture);
-
-          node->background_texture = subtexture;
-        }
-      else
-        {
-          node->background_texture = texture;
-        }
-
+      node->background_texture = st_texture_cache_load_file_to_cogl_texture (texture_cache, background_image);
       node->background_material = _st_create_texture_material (node->background_texture);
 
       if (background_image_shadow_spec)